#include "SelectionTool_RectSlot.h"

#include "TopoDS.hxx"
#include "TopoDS_Wire.hxx"

#include "OccUtility.h"

SelectionTool_RectSlot::SelectionTool_RectSlot(Handle(AIS_InteractiveContext) theContext)
	: SelectionTool(theContext)
{

}

void SelectionTool_RectSlot::Initialize(Handle(SelectMgr_Filter) filter)
{
	SelectionTool::Initialize(TopAbs_WIRE, filter);
}

void SelectionTool_RectSlot::Move(const Standard_Integer& x, const Standard_Integer&  y, const Handle(V3d_View)& myView)
{
	SelectionTool::Move(x, y, myView);
}

void SelectionTool_RectSlot::Pick(const Standard_Integer& x, const Standard_Integer&  y, const Handle(V3d_View)& myView)
{
	myAisContext->Select(Standard_True);

	myAisContext->InitSelected();
	if (myAisContext->MoreSelected()) {
		TopoDS_Wire theWire = TopoDS::Wire(myAisContext->SelectedShape());
		occ_utility::PrintWireInfo(theWire);
	}
}
